
--I want this to spit out an ideal made up of polynomials which have to be satisfied by the coefficients of the quintic to ensure that (1,1,1,1) is on the quintic.

NewSing = (p) -> (  
     R1=ZZ/p[a,b,c,e,f,m,x,y,z,t, Degrees=>{0,0,0,0,0,0,1,1,1,1}];
     quintic=sub((x+m*y+a*z)^2*t^3+(a^2*x^3+x*y*(b*x+c*y)+m^2*y^3+(e*x^2+f*x*y+c*y^2)*z+(b*x+e*y)*z^2+z^3)*t^2+(2*a*x^3*y+e*x^2*y^2+2*a*m*x*y^3+(2*a*m*x^3+f*x^2*y+f*x*y^2+2*m*y^3)*z+(c*x^2+f*x*y+b*y^2)*z^2+2*(m*x+a*y)*z^3)*t+x^3*y^2+a^2*x^2*y^3+x*y*z*(2*m*x^2+b*x*y+2*a*y^2)+z^2*(m^2*x^3+c*x^2*y+e*x*y^2+y^3)+(m*x+a*y)^2*z^3,t=>1);
     
     R1=ZZ/p[a,b,c,e,f,m,x,y,z, Degrees=>{0,0,0,0,0,0,1,1,1}];
     quintic=sub(quintic, R1);
     
     Der1=diff(x,quintic);
     Der2=diff(y,quintic);
     Der3=diff(z,quintic);
     
     f0=-a^2*m^3+b*m^2-c*m+m^2; --coefficients of y^3, z^3, y^2*z, y*z^2 after making quadratic term zero
     f1=-a*b+a^2*e+1-a^5;
     f2=(-m*b+a^2*b+2*a*m*e+e-a*f-3*a^4*m);
     f3=(2*a*m*b+c-a*c+m^2*e-m*f-3*a^3*m^2);
     
     pol1=3*f0*f2-9*f1^2; -- from cubic term (after making quadratic term 0) be cube of linear form
     pol2=f0*f3-9*f1*f2;
     pol3=3*f1*f3-9*f2^2;
     
     
     pol4=(-6*a^4*b+4*a^2*c+12*a^5*e-b^2+4*a*b*e-4*a^2*e^2-8*a*m-8*a^4*m-9*a^8); -- from vanishing of discriminant of quadratic part after blowup. (only works for special direction y=0)
     
     pol5=(m*b+3*a^3*m*b-a*b*c+a^2*c*e-4*a^4*m*e-a^2*m^2+a^3*m^2-3*a^4*m+3*a^7*m); --from CG
     pol6=(-6*a^3*m*b+6*a^5*b+4*a*m*c+18*a^4*m*e-2*a*f+2*a^2*f-3*a^4*f+2*a*b^2+2*m*b*e-4*a^2*b*e-b*f+2*a*e*f-4*a*m*e^2+4*a-12*a^3*m^2-18*a^7*m-4*a^4-4*m^2); --from CG
     
     pol7=sub(quintic, {x=>1,y=>1,z=>1}); --making (1,1,1) be on the surface and singular
     
     --pol8=sub(Der1, {x=>1,y=>1,z=>1}); these are commented out because if (1,1,1) is on the surface, then it's singular
     --pol9=sub(Der2, {x=>1,y=>1,z=>1}); 
     --pol10=sub(Der3, {x=>1,y=>1,z=>1});
     
     B=-pol7/4+b;  --replacing b using the fact that (1,1,1) is on the surface.
     
     newpol1=sub(pol1,{b=>B});
     newpol2=sub(pol2,{b=>B});
     newpol3=sub(pol3,{b=>B});
     newpol4=sub(pol4,{b=>B});
     newpol5=sub(pol5,{b=>B});
     newpol6=sub(pol6,{b=>B});
     
     
     R2=ZZ/p[a,c,e,f,m];
     newpol1=sub(newpol1,R2);
     newpol2=sub(newpol2,R2);
     newpol3=sub(newpol3,R2);
     newpol4=sub(newpol4,R2);
     newpol5=sub(newpol5,R2);
     newpol6=sub(newpol6,R2);
     
     J=ideal(newpol1, newpol2, newpol3, newpol4, newpol5, newpol6); 
     
     J)




